package top.zhangjianyong.tools.service.api.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.zhangjianyong.tools.entity.Dictionary;
import top.zhangjianyong.tools.service.api.DictionaryService;
import top.zhangjianyong.tools.service.mybatis.IDictionaryService;
import top.zhangjianyong.tools.utils.ApiResponse;

import java.util.List;

/**
 * @author ： zhangjianyong
 * @date ： 2022/5/12 10:24 AM
 */
@Service
public class DictionaryServiceImpl implements DictionaryService {

    @Autowired
    private IDictionaryService iDictionaryService;

    @Override
    public ApiResponse list(String key) {
        List<Dictionary> list = iDictionaryService.lambdaQuery()
                .eq(Dictionary::getDictKey, key)
                .eq(Dictionary::getDelFlag, 0)
                .list();
        return ApiResponse.success(list);
    }
}
